home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Turnbull China Bikeride
/
Turnbull China Bikeride - Disc 2.iso
/
STUTTGART
/
TEMP
/
GNU
/
bison
/
Semantics
< prev
next >
Wrap
Text File
|
1995-06-28
|
1KB
|
26 lines
Semantics
Previous: <Recursion=>Recursion> * Next: <Declarations=>Declaratio> * Up: <Grammar File=>GrammarFil>
#Wrap on
{fH3}Defining Language Semantics{f}
The grammar rules for a language determine only the syntax. The semantics
are determined by the semantic values associated with various tokens and
groupings, and by the actions taken when various groupings are recognized.
For example, the calculator calculates properly because the value
associated with each expression is the proper number; it adds properly
because the action for the grouping {fEmphasis}{fStrong}x{f} + {fStrong}y{f}{f} is to add
the numbers associated with {fStrong}x{f} and {fStrong}y{f}.
#Wrap off
<Value Type=>ValueType>: Specifying one data type for all semantic values.
<Multiple Types=>MultipleTy>: Specifying several alternative data types.
<Actions=>Actions>: An action is the semantic definition of a grammar rule.
<Action Types=>ActionType>: Specifying data types for actions to operate on.
<Mid-Rule Actions=>MidRuleAct>: Most actions go at the end of a rule.
This says when, why and how to use the exceptional
action in the middle of a rule.
#Wrap on